package org.kepler.chat.api.infra.security.exceptions;

import org.kepler.chat.api.infra.util.ErrorCode;
import org.springframework.security.core.AuthenticationException;

/**
 * 
 * @author ake
 *
 * Aug 3, 2016
 */
public class JwtBadCredentialsException extends AuthenticationException {
    private static final long serialVersionUID = -5959543783324224864L;

    private ErrorCode errorCode;

    public JwtBadCredentialsException(String msg) {
        super(msg);
    }

    public JwtBadCredentialsException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public JwtBadCredentialsException(ErrorCode errorCode, Throwable t) {
        super(errorCode.getMessage(), t);
        this.errorCode = errorCode;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }
}
